package ${basePackage}.controller.${modulePackage};

import ${basePackage}.base.result.PageResult;
import ${basePackage}.base.result.ResultData;
import ${basePackage}.service.${modulePackage}.${moduleName}Service;
import ${basePackage}.model.${modulePackage}.add.${moduleName}AddParams;
import ${basePackage}.model.${modulePackage}.add.${moduleName}AddVo;
import ${basePackage}.model.${modulePackage}.delete.${moduleName}DeleteParams;
import ${basePackage}.model.${modulePackage}.delete.${moduleName}DeleteVo;
import ${basePackage}.model.${modulePackage}.detail.${moduleName}DetailParams;
import ${basePackage}.model.${modulePackage}.detail.${moduleName}DetailVo;
import ${basePackage}.model.${modulePackage}.list.${moduleName}ListParams;
import ${basePackage}.model.${modulePackage}.list.${moduleName}ListVo;
import ${basePackage}.model.${modulePackage}.page.${moduleName}PageParams;
import ${basePackage}.model.${modulePackage}.page.${moduleName}PageVo;
import ${basePackage}.model.${modulePackage}.tree.${moduleName}TreeParams;
import ${basePackage}.model.${modulePackage}.tree.${moduleName}TreeVo;
import ${basePackage}.model.${modulePackage}.update.${moduleName}UpdateParams;
import ${basePackage}.model.${modulePackage}.update.${moduleName}UpdateVo;
import io.swagger.annotations.Api;
import javax.annotation.Resource;

import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

/**
 * @version: ${version}
 * @author: ${author}
 * @date: ${date?string("yyyy/MM/dd HH:mm")}
 * @description: ${name}
 */
@Api(tags = "${name}")
@RestController
@RequestMapping("${modulePath}")
public class ${moduleName}Controller {

    @Resource
    private ${moduleName}Service ${moduleName?uncap_first}Service;


    /**
     *
     * ${name} :分页
     *
     * @param params
     * @return
     */
    @ApiOperation(value = "分页-未使用")
    @PostMapping("page")
    public ResultData<PageResult<${moduleName}PageVo>> page(@Validated @RequestBody ${moduleName}PageParams params){
        PageResult<${moduleName}PageVo> data = ${moduleName?uncap_first}Service.page(params);
        return ResultData.success(data);
    }


    /**
     *
     * 列表
     *
     * @param params
     * @return
     */
    @ApiOperation(value = "列表-未使用")
    @PostMapping("list")
    public ResultData<List<${moduleName}ListVo>> list(@Validated @RequestBody ${moduleName}ListParams params){
        List<${moduleName}ListVo> data = ${moduleName?uncap_first}Service.list(params);
        return ResultData.success(data);
    }

    /**
     *
     * 树
     *
     * @param params
     * @return
     */
    @ApiOperation(value = "树结构-未使用")
    @PostMapping("tree")
    public ResultData<List<${moduleName}TreeVo>> tree(@Validated @RequestBody ${moduleName}TreeParams params){
        List<${moduleName}TreeVo> data = ${moduleName?uncap_first}Service.tree(params);
        return ResultData.success(data);
    }

    /**
     *
     * 增加
     *
     * @param params
     * @return
     */
    @ApiOperation(value = "增加-未使用")
    @PostMapping("add")
    public ResultData<${moduleName}AddVo> add(@Validated @RequestBody ${moduleName}AddParams params){
        ${moduleName}AddVo data = ${moduleName?uncap_first}Service.add(params);
        return ResultData.success(data);
    }

    /**
     *
     * 修改
     *
     * @param params
     * @return
     */
    @ApiOperation(value = "修改-未使用")
    @PostMapping("update")
    public ResultData<${moduleName}UpdateVo> update(@Validated @RequestBody ${moduleName}UpdateParams params){
        ${moduleName}UpdateVo data = ${moduleName?uncap_first}Service.update(params);
        return ResultData.success(data);
    }

    /**
     *
     * 详情
     *
     * @param params
     * @return
     */
    @ApiOperation(value = "详情-未使用")
    @PostMapping("detail")
    public ResultData<${moduleName}DetailVo> detail(@Validated @RequestBody ${moduleName}DetailParams params){
        ${moduleName}DetailVo data = ${moduleName?uncap_first}Service.detail(params);
        return ResultData.success(data);
    }

    /**
     *
     * 删除
     *
     * @param params
     * @return
     */
    @ApiOperation(value = "删除-未使用")
    @PostMapping("delete")
    public ResultData<${moduleName}DeleteVo> delete(@Validated @RequestBody ${moduleName}DeleteParams params){
        ${moduleName}DeleteVo data = ${moduleName?uncap_first}Service.delete(params);
        return ResultData.success(data);
    }
}
